/*
package com.hh;

import com.hh.item.dao.IMessageDao;
import com.hh.item.dao.IUserDao;
import com.hh.item.pojo.Message;
import com.hh.item.pojo.User;
import com.hh.item.service.IMessageService;
import com.hh.item.service.IUserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import tk.mybatis.mapper.entity.Example;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

*/
/**
 * @author yangfan
 * @date 2020/3/11 18:15
 * @description
 *//*

@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
public class test {

    @Autowired
    private IUserService userService;

    @Autowired
    private IUserDao userDao;

    @Autowired
    private IMessageService messageService;

    @Test
    public void login(){
        User user = userService.login("huanhuan", "zxc");
        System.out.println(user);
    }

    @Test
    public void check(){
        String userName = "huanhn";

        Example example = new Example(User.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("userName",userName);

        List<User> user = userDao.selectByExample(example);
        System.out.println(user);
        System.out.println(user.size());
        System.out.println(user.isEmpty());
    }

    @Test
    public void sent(){
        Message message = new Message();
        message.setUserId(1);
        message.setMsgContent("一条测试微博");
        System.out.println(messageService.sent(message));
    }

    @Test
    public void data(){
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat();
        String date = simpleDateFormat.format(new Date());
        System.out.println(date);
    }
}
*/
